window.onload = function() {
    var eye = document.getElementById("eye")
    var eye1 = document.getElementById("eye1")
    var pwd = document.getElementById("mima")
    var pwd1 = document.getElementById("mima1")
    var flag = 0;
    eye.onclick = function() {
        if (flag == 0) {
            pwd.type = "text";
            eye.src = "images/open.png"
            flag = 1;
        } else {
            pwd.type = "password";
            eye.src = "images/close.png"
            flag = 0;
        }

    }
    mima1.onblur = function() {
        if (pwd1.value != pwd.value) {
            alert("两次密码不一样")
        }
        console.log(pwd1.value);
    }

    eye1.onclick = function() {
        if (flag == 0) {
            pwd1.type = "text";
            eye1.src = "images/open.png"
            flag = 1;
        } else {
            pwd1.type = "password";
            eye1.src = "images/close.png"
            flag = 0;
        }

    }
}